package com.itheima.stock.mapper;

import com.itheima.stock.common.domain.*;
import com.itheima.stock.pojo.StockRtInfo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author 11873
* @description 针对表【stock_rt_info(个股详情信息表)】的数据库操作Mapper
* @createDate 2023-04-04 19:02:00
* @Entity com.itheima.stock.pojo.StockRtInfo
*/
public interface StockRtInfoMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockRtInfo record);

    int insertSelective(StockRtInfo record);

    StockRtInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockRtInfo record);

    int updateByPrimaryKey(StockRtInfo record);

    List<StockUpdownDomain> stockIncreaseLimit(@Param("curTime") Date curDateTime);

    List<StockUpdownDomain> stockAll();

    List<Map> upDownCount(@Param("avlDate") Date lastDate,@Param("openDate") Date openTime, @Param("flag") Integer flag);

    List<Map> stockUpDownScopeCount(@Param("avlDate") Date avlDate);

    List<Stock4MinuteDomain> stockScreenTimeSharing(@Param("stockCode") String code, @Param("startDate") Date avlDate, @Param("endtDate") Date endDate);

    /**
     *  统计指定股票在指定日期范围内的每天交易数据统计
     * @param code 股票编码
     * @param beginDate 前推的日期时间
     * @return
     */
    List<Stock4EvrDayDomain> stockCreenDkLine(@Param("stockCode") String code, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    /**
     * 批量插入功能
     * @param stockRtInfoList
     */
    int insertBatch(@Param("list") List<StockRtInfo> stockRtInfoList);

    /**
     *
     * @param code
     * @param startDate 开始时间
     * @param endDate 结束时间
     * @return
     */
    List<Stock4EvrWeekDomain> stockCreenWkLine(@Param("code") String code,
                                               @Param("startDate") Date startDate,
                                               @Param("endDate") Date endDate);

    /**
     *
     * @param code 股票编码
     * @param lastDate 最新时间
     * @return
     */
    StockNowDomain getNewStock(@Param("code") String code,@Param("time") Date lastDate);

    List<Stock4Limit10Domain> stockDaySort(@Param("code") String code,
                                           @Param("openDate") Date openDate,
                                           @Param("currentDate") Date currentDate);
}
